<?php 
require_once('desconto2d/start_parceiro.php');
require_once('desconto2d/class/Layout.php');
require_once('desconto2d/class/Parceiro.php');

$conn = $GLOBALS['connectionDefault'];
$logger = Logger::getInstance();

$id = Parceiro::getParceiro();
	
$query = sprintf("SELECT * FROM parceiro WHERE id_parceiro = %0d", $id);
if(!$conn->query($query))$logger->gravaLogErro('Erro ao buscar parceiro', $conn->error, null, $query);
$rec = $conn->next();

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="../style/style.css" rel="stylesheet" type="text/css" />
<title>2D Desconto</title>

</head>
<body>

<?php 
	echo Layout::getTopoForms();
?>

	<div id="forms">


<!-- ///////////////////////////////////////////////////////////////////////////// -->

<div id="fields">

<form  action="alterar_senha_parceiro_p.php" method="post">

<?php 
		echo sprintf('<input type="hidden" name="id_parceiro" id="id_parceiro" value="%s">', $id);
		echo sprintf('<input type="hidden" name="senha_antiga" id="senha_antiga" value="%s">', $rec['senha']);
?>
<table align="center">

<tr><th colspan="2"><h1>Parceiro</h1></th></tr>
<tr>
	<td><strong>Nome:</strong></td>
	<td>
	<?php 
		echo sprintf('<input type="text" name="nome" id="nome" size="50" value="%s" readonly/>', $rec['nome']);
	?>
	</td>
</tr>

<tr>
	<td><strong>Username:</strong></td>
	<td>
	<?php 
		echo sprintf('<input type="text" name="username" id="username" size="50" value="%s" readonly/>', $rec['username']);
	?>
	</td>
</tr>

<tr>
	<td><strong>Senha:</strong></td>
	<td>
	<?php 
		echo sprintf('<input type="password" name="senha" id="senha" size="50" value="%s" />', $rec['senha']);
	?>
	</td>
</tr>

<tr>
	<td></td>
	<td><input type="submit" name="submit" id="btn_enviar" class="btn" value="Enviar" /></td>
</tr>

</table>
</form>

</div><!-- FIELDS -->


<!-- ///////////////////////////////////////////////////////////////////////////// -->


	</div><!-- FORMS -->

</body>
</html>